import { http } from "@/utils/http";

export interface InsertContentClassify {
  name: string;
  code: string;
  desc: string;
  mainImg: string;
  businessScene: number;
  isEnable: number;
}

export interface UpdateContentClassifyById {
  id: number;
  name: string;
  code: string;
  desc: string;
  mainImg: string;
  businessScene: number;
  isEnable: number;
}

export interface RemoveContentClassifyById {
  classifyId: number;
}

export interface EnableContentClassifyById {
  classifyId: number;
  enable: number;
}

export interface QueryContentClassifyById {
  classifyId: number;
}

export interface ContentClassifyVO {
  id: number;
  name: string;
  code: string;
  desc: string;
  mainImg: string;
  businessScene: number;
  isEnable: number;
  createUser: string;
}

export interface ContentClassifyBaseVO {
  id: number;
  name: string;
  code: string;
  desc: string;
  mainImg: string;
  businessScene: number;
  isEnable: number;
  createUser: string;
}

export interface QueryContentClassifyByCondition extends BizPageReq {
  id: number;
  name: string;
  code: string;
  businessScene: number;
  isEnable: number;
  createUser: string;
}

//新增内容分类信息
export const insertContentClassifyApi = (data: InsertContentClassify) => {
  return http.request<BizResponse<boolean>>(
    "post",
    "/content/classify/insertContentClassify",
    {
      data
    }
  );
};

//更新内容分类信息
export const updateContentClassifyByIdApi = (
  data: UpdateContentClassifyById
) => {
  return http.request<BizResponse<boolean>>(
    "post",
    "/content/classify/updateContentClassifyById",
    {
      data
    }
  );
};

//删除内容分类信息
export const removeContentClassifyByIdApi = (
  data: RemoveContentClassifyById
) => {
  return http.request<BizResponse<boolean>>(
    "post",
    "/content/classify/removeContentClassifyById",
    {
      data
    }
  );
};

//启禁用内容分类信息
export const enableContentClassifyByIdApi = (
  data: EnableContentClassifyById
) => {
  return http.request<BizResponse<boolean>>(
    "post",
    "/content/classify/enableContentClassifyById",
    {
      data
    }
  );
};

//查询内容分类详情
export const queryContentClassifyByIdApi = (data: QueryContentClassifyById) => {
  return http.request<BizResponse<ContentClassifyVO>>(
    "post",
    "/content/classify/queryContentClassifyById",
    {
      data
    }
  );
};

//多条件查询内容分类信息
export const queryContentClassifyByConditionApi = (
  data: QueryContentClassifyByCondition
) => {
  return http.request<BizResponse<BizPageResult<ContentClassifyBaseVO>>>(
    "post",
    "/content/classify/queryContentClassifyByCondition",
    {
      data
    }
  );
};
